<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="/header.xhtml">
            <ui:define name="menu">
                  <h:commandLink value="Inicio" action="/header.xhtml" />
        </ui:define>
             <ui:define name="conteudo">
            <legend><i class="icon-edit"></i>Cadastro de pedido</legend>
            <h:inputHidden value="#{pedidoMB.pedido.id}"/>
            <div style="margin-left: 45px;">
                <h:panelGrid columns="1">

                    <h:outputLabel class="control-label">Id</h:outputLabel>
                    <h:inputText value="#{pedidoMB.pedido.id}" class="input-large" required="true" readonly="true" />

                    <h:outputLabel class="control-label">Data</h:outputLabel>
                    <h:inputText value="#{pedidoMB.pedido.data}" class="input-large" required="true"/>

                    <h:outputLabel class="control-label">Mesa</h:outputLabel>
                    <h:inputText value="#{pedidoMB.pedido.mesa}" class="input-large" required="true"/>

                    <h:selectOneRadio>
                        <f:selectItem itemLabel="Ativo" itemValue="1" />
                        <f:selectItem itemLabel="Cozinha" itemValue="2" />
                        <f:selectItem itemLabel="Inativo" itemValue="3" />
                    </h:selectOneRadio>

<!--                    <h:dataTable var="produtos" value="#{pedidoMB.produtos}" class="table table-bordered">

                        <h:column  class="info">
                            <f:facet name="header">
                                <h:commandLink value="Nome" action="#{pedidoMB.ordenaNome()}" />

                            </f:facet>
                    #{produtos.nome}  

                </h:column>
                <h:column  class="info">
                    <f:facet name="header">
                        <h:commandLink value="Valor" action="#{pedidoMB.ordenaValor()}" />
                    </f:facet>
                    #{produtos.valor}  
                </h:column>
                <h:column  class="info">
                    <f:facet name="header">
                    </f:facet>
                    <h:commandButton value="+" action="#{pedidoMB.maisProduto()}" class="btn  pull-left"></h:commandButton>
                </h:column>
                <h:column  class="info">
                    <f:facet name="header">
                    </f:facet>
                    <h:commandButton value="-" action="#{pedidoMB.menosProduto()}" class="btn  pull-left"></h:commandButton>
                </h:column>
                <h:column  class="info">
                    <f:facet name="header">
                        quantidade
                    </f:facet>
                    <h:inputText value="#{pedidoMB.produto.quantidade}" class="input-large" required="true"/>
                </h:column>
            </h:dataTable>-->
                    <table class="table table-bordered">
                        <thead><tr>
                                <th class="info" scope="col">Name</th>
                                <th class="info" scope="col">Valor</th>
                                <th class="info" scope="col">Quantidade</th>
                                  <th class="info" scope="col">Subtotal</th>
                                <th class="info" scope="col"></th>
                                <th class="info" scope="col"></th>
                            </tr></thead>

                        <tr class="employeeTableOddRow">
                            <td>Drink</td>
                            <td>10,00</td>
                            <td>2</td>
                            <td>20,00</td>
                            <td><Button value="-" class="btn btn-danger pull-left">-</Button></td>
                            <td>
                                 <Button value="+" class="btn btn-success pull-left">+</Button>
                            </td>
                        </tr>
                        <tr class="employeeTableEvenRow">
                            <td>Batatas</td>
                            <td>20,00</td>
                            <td>0</td>
                            <td>0</td>
                            <td> <Button value="-" class="btn btn-danger pull-left">-</Button></td>
                            <td>
                                 <Button value="+" class="btn btn-success pull-left">+</Button>
                            </td>
                        </tr>
                    </table>
                    <h:outputLabel class="control-label">Valor Total</h:outputLabel>
                    <h:inputText value="#{pedidoMB.pedido.valorTotal}" class="input-large" required="true" readonly="true" requiredMessage="t"/>
                </h:panelGrid>
            </div>

            <div class="form-actions">
                <h:commandButton value="Salvar" action="#{pedidoMB.salvar()}" class="btn btn-inverse  pull-right" onclick="return confirm('Deseja realmente salvar?')" style="margin-left: 10px;"></h:commandButton>
                  <h:commandButton value="Pagar (abre popup processo de pagar)" action="#{pedidoMB.pagar()}" class="btn btn-success  pull-right" onclick="return confirm('Deseja realmente pagar?')"></h:commandButton>
                <h:commandButton value="Limpar" action="#{pedidoMB.novo()}" class="btn  pull-left"></h:commandButton></div>
        </ui:define>
    </ui:composition>
</html>
